package org.dandsoft.blackbox.snn;

/**
 * Created by IntelliJ IDEA.
* User: dvilyuzhanin
* Date: 31.03.2009 0:25:41
*/
public class Synapse {
    private ObjectId signalId;
    private Time time;
    private Value value;
    private boolean isUseful;
    private Value weight = Value.PASSIVE;
    private Value minValue = Value.PASSIVE;
    private Value maxValue = Value.ACTIVE;

    public void correct() {
        if (getMinValue().isGreater(getValue())) {
            setMinValue(getValue());
        }

        if (getMaxValue().isLower(getValue())) {
            setMaxValue(getValue());
        }
    }

    public ObjectId getSignalId() {
        return signalId;
    }

    public void setSignalId(ObjectId signalId) {
        this.signalId = signalId;
    }

    public Time getTime() {
        return time;
    }

    public void setTime(Time time) {
        this.time = time;
    }

    public Value getValue() {
        return value;
    }

    public void setValue(Value value) {
        this.value = value;
    }

    public boolean isUseful() {
        return isUseful;
    }

    public void setUseful(boolean useful) {
        isUseful = useful;
    }

    public Value getWeight() {
        return weight;
    }

    public void setWeight(Value weight) {
        this.weight = weight;
    }

    public Value getMinValue() {
        return minValue;
    }

    public void setMinValue(Value minValue) {
        this.minValue = minValue;
    }

    public Value getMaxValue() {
        return maxValue;
    }

    public void setMaxValue(Value maxValue) {
        this.maxValue = maxValue;
    }
}
